import {makeAutoObservable,runInAction} from 'mobx'
class NumberStore{
  number=100
  constructor(){
    makeAutoObservable(this,{},{autoBind:true})
  }
  changeNum(val){
    this.number+=val
  }
  changeAsync(){
    //runInAction异步操作改变状态值
    setTimeout(()=>{
      runInAction(()=>{
        this.number+=47
      })
    },2000)
  }
}

const Numberstore=new NumberStore()
export default Numberstore